package com.nxmu.entity;

import javax.persistence.*;

@Entity
@Table(name = "OFFICE_ENTER")
public class OfficeEnter {

    @Id
    private Integer id;

    @Column(name = "WORK_LOAD")
    private int workLoad;

    //这是维护关联关系的一方
    //在这一边加入外键列，列名为USER_ID,并且将该列设置为唯一约束
    @JoinColumn(name = "USER_ID", unique = true)
    @OneToOne
    private User user;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getWorkLoad() {
        return workLoad;
    }

    public void setWorkLoad(int workLoad) {
        this.workLoad = workLoad;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
